{% extends theme('base.html') %}

{% block content %}
  <h1 id="">All Examples</h1>
  <div>&nbsp;</div>
  <table class="table table-bordered table-striped">
    <thead>
      <tr>
        <th>ID</th>
        <th>Name</th>
        <th>Description</th>
        <th>Added by</th>
        <th>Added on</th>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
      </tr>
    </thead>
    <tbody>
      {% for example in examples %}
        {% set example_id = example.key.id() %}
        <tr>
          <td>{{example_id}}</td>
          <td>{{example.example_name}}</td>
          <td>{{example.example_description}}</td>
          <td>{{example.added_by}}</td>
          <td class="nowrap">{{example.timestamp.strftime('%b %d, %Y %I:%M %p')}}</td>
          <td>
            <a href="{{url_for('ExampleBP.edit_example', example_id=example_id)}}" class="btn">Edit</a>
          </td>
          <td>
            <form method="post" action="{{url_for('ExampleBP.delete_example', example_id=example_id)}}">
              <button class="btn">Delete</button>
            </form>
          </td>
        </tr>
      {% else %}
        <tr><td colspan="7">No examples yet</td></tr>
      {% endfor %}
    </tbody>
  </table>
  <p>
    <a class="btn btn-primary" data-toggle="modal" data-target="#new-example-modal">
      <i class="icon-plus-sign icon-white"></i>  New example
    </a>
  </p>

  {% include theme('examples/new.html') %}
{% endblock content %}

{% block bootstrap_js_bottom -%}
  {{super()}}
  <script src="{{theme_static('js/examples/main.js')}}"></script>
{%- endblock %}
